import BaseEntity from "./BaseEntity.js";
import CommonUtil from "../../util/commonUtil.js";
/**
 * 点状Entity基类
 * @class
 * @extends graphic.entity.BaseEntity
 */
class BasePointEntity extends BaseEntity {
  constructor(options) {
    super(options);
  }

  /**
   * 检查位置参数是否有效
   */
  checkPosition() {
    if (!this._position) {
      throw new Error("position is required");
    }
    this.position = CommonUtil.positionToCartesian3(this._position);
  }

  /**
   * 获取样式参数
   * @returns {Object} 样式参数
   */
  get style() {
    return { position: this._position, point: this._style };
  }
}

export default BasePointEntity;
